include( "shared.lua" )
include( "admin_menu.lua" )
require( "datastream" )

surface.CreateFont( "coolvetica", 28, 500, true, false, "LogoFont" )
//surface.CreateFont( "coolvetica", 22, 500, true, false, "BoardPlayerNameBig" )
surface.CreateFont( "coolvetica", 19, 500, true, false, "BoardName" )

Gradient = surface.GetTextureID( "gui/gradient" )

SB = nil

function ScoreMenu()
if !CanScoreboard or !CanF2 then
	LocalPlayer():ChatPrint( "Wait for rank information to be received before using the scoreboard." )
	return true
end
if CanScoreboard and CanF2 then
	SB = vgui.Create( "SBoard" )
		SB:SetSize( ScrW() * 0.75, ScrH() * 0.6 )
		SB:Center()
end
return true
end
hook.Add( "ScoreboardShow", "ScoreMenu", ScoreMenu )

function CloseScoreMenu()
if CanScoreboard and CanF2 and SB and SB:IsValid() then
	SB:SetVisible( false )
	SB:Remove()	
	SB = nil
end
return true
end
hook.Add( "ScoreboardHide", "CloseScoreMenu", CloseScoreMenu )
